import re
pattern = r'([1-9]{1,3}(\.[0-9]{1,3}){3})'#把整个模式字符串分成一组
string = '127.0.0.1.192.168.1.66'#要匹配的字符串
match = re.findall(pattern,string)
for item in match:
  print(item[0])
